<template>
	<div class="about2">
		<div class="b-top">
			<el-breadcrumb separator-class="el-icon-arrow-right" class="b-top-text">
				<el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
				<el-breadcrumb-item :to="{ path: `/about1?id=${breadcrumb.parentId}&name=${breadcrumb.parentName}`}">{{breadcrumb.parentName}}</el-breadcrumb-item>
				<el-breadcrumb-item>{{breadcrumb.name}}</el-breadcrumb-item>
			</el-breadcrumb>
		</div>
		<OtherPages2 :oneMenu="oneMenu" :menuList='menuList'></OtherPages2>
	</div>
</template>

<script>
	import OtherPages2 from '@/components/OtherPages2.vue'
	export default {
		name: 'AboutView2',
		components: { OtherPages2 },
		data() {
			return {
				oneMenu: {},
				yijiList: [],
				menuList: [],
				breadcrumb: {}
			}
		},
		watch: {
			$route: {
				async handler(to) {
					console.log(1)
					// 获取二级菜单数据
					const oneMenu = await this.$http.twoMenu({ id: to.query.id })
					const menuList = await this.$http.menuLisApi({page:1,pageSize:20})
					this.oneMenu = oneMenu;
					this.menuList = menuList;
					this.breadcrumb = this.oneMenu.data.result;
					console.log(this.oneMenu)
				},
				immediate: true,
			},
		},
	}
</script>

<style lang="scss" scoped>
.b-top {
	width: 1220px;
	height: 22px;
	padding: 25px 10px;
	margin: 0 auto;
	.b-top-text {
		line-height: 22px;
	}
}
</style>